#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "../util.h"
#include "../getopt_helper.h"

/* Act like "true" by default; false.c overrides this. */
#ifndef EXIT_STATUS
#	define EXIT_STATUS EXIT_SUCCESS
#endif

#if EXIT_STATUS == EXIT_SUCCESS
#	define PROGRAM_NAME "true"
#else
#	define PROGRAM_NAME "false"
#endif

#define NFORMAT 2
const char usage_str[] =
    "Usage: %s [ignored command line arguments]\n"
    "  or:  %s OPTION\n"
    "Exit with a status code indicating "
#if EXIT_STATUS == EXIT_SUCCESS
    "success"
#else
    "failure"
#endif
    ".\n"
    "\n"
    "      --help     display this help and exit\n"
    "      --version  output version information and exit\n"
    "\n"
    "NOTE: your shell may have its own version of " PROGRAM_NAME
    ", which usually supersedes\n"
    "the version described here.  Please refer to your shell's documentation\n"
    "for details about the options it supports.";

int
main(int __unused argc, char *argv[])
{
	if (*++argv) {
		if (STREQ(*argv, "--help")) usage(EXIT_STATUS);
		if (STREQ(*argv, "--version")) {
			print_version();
			return EXIT_STATUS;
		}
	}

	return EXIT_STATUS;
}
